home *** CD-ROM | disk | FTP | other *** search
- Path: news.asu.edu!ryan1m
- From: ryan1m@imap2.asu.edu
- Newsgroups: comp.lang.c++
- Subject: HELP: Code in Header Files
- Date: 27 Mar 1996 05:43:18 GMT
- Organization: Arizona State University
- Message-ID: <4jakhm$g3d@news.asu.edu>
- NNTP-Posting-Host: general2.asu.edu
- X-Newsreader: TIN [version 1.2 PL2]
-
-
- I have a problem understanding how header files work. If it matters I am
- using Borland C++ 4.5...
-
- The problem is I defined a header file string.h in this I declared a
- string class. If I put the actual code to the functions in this class
- into the header file, the compiler does not like it. I looked at other
- .h files and saw they did not do it this way.
-
- So then I tried writing the actual code into string.cpp and compiling
- that with and #include "string.h".
-
- It worked but my code for my program does not recognize the functions.
- It says I did not code them yet.
-
- It finds the headers just fine but not the actual code.
-
- ie:
-
- #include "string.h"
-
- void main(void)
- {
- String blah("hello world");
- }
-
- the error will say something like
-
- Undefined Symbol String::~String() in module STEST.CPP
-
- and it goes on to list the rest of the function not "defined".
-
- Please help...
-
- Thanks,
-
- Mike Ryan ryan1m@asu.edu
-
-